<!-- #layout name=blank-->
<div class="page-header">
    <h1 class="title">Products management</h1>
</div>
<div data-bind="component: { name: 'kb-breadcrumb', params:[{
    name: 'SITES'
},{
    name: 'DASHBOARD'
},{
    name: Kooboo.text.common.ProductManagement
}]}"></div>
<div class="navbar navbar-default">
    <div class="container-fluid">
        <div class="btn-group navbar-btn">
            <div class="btn-group">
                <button class="btn green dropdown-toggle" data-toggle="dropdown"><span>Add product</span>&nbsp;<i class="fa fa-angle-down"></i></button>
                <ul class="dropdown-menu">
                    <!-- ko if: productTypes().length -->
                    <!-- ko foreach: productTypes -->
                    <li>
                        <a data-bind="text: $data.name, attr: { href: Kooboo.Route.Get(Kooboo.Route.Product.DetailPage, { type: $data.id }) }"></a>
                    </li>
                    <!-- /ko -->
                    <!-- /ko -->
                    <!-- ko ifnot: productTypes().length -->
                    <li>
                        <a href="javascript:;" data-bind="attr: { href: Kooboo.Route.Product.Type.DetailPage }">Create a new type first</a>
                    </li>
                    <!-- /ko -->
                </ul>
            </div>
        </div>
        <a data-bind="visible: showDeleteBtn, click: onDelete" class="btn red navbar-btn">Delete</a>
    </div>
</div>
<div data-bind="component: { name: 'kb-table', params: tableData }"></div>
<div data-bind="component: { name: 'kb-pager', params: pager }"></div>
<script>
    (function() {
        Kooboo.loadJS([
            "/_Admin/Scripts/kooboo/Guid.js",
            "/_Admin/Scripts/components/kbTable.js",
            "/_Admin/Scripts/components/kbBreadcrumb.js",
            "/_Admin/Scripts/tableModel.js",
            "/_Admin/Scripts/components/kbPager.js"
        ]);
    })()
</script>
<script src="/_Admin/View/ECommerce/Products.js"></script>